public class Queen implements Piece {

    private Color color;
    private int moveCount;

    public Queen( Color color ) {
	this.color = color;
	moveCount = 0;
    }

    
    public boolean legalMove( int x1, int y1, int x2, int y2) {
	if( (x2==x1) && (y2==y1) ) {
	    return false;
	}
	if( y2 == y1 ) {
	    return true;
	} else if( x2 == x1 ) {
	    return true;
	}
	int deltaX = Math.abs(x2-x1);
	int deltaY = Math.abs(y2-y1);
	if( deltaX == deltaY ) {
	    return true;
	}
	return false;
    }

    public Color color() {
	return color;
    }

    public String name() {
	return "Queen";
    }

    public void movesPlusOne() {
	moveCount += 1;
    }
    
    public int moveCount() {
	return moveCount;
    }

}
